<template>
  <div class="wrapper">
    <!-- 返回首页 -->
    <uni-bankhome />
    <u-parse v-html="res.content"></u-parse>
  </div>
</template>
<script>
  import {
    getArticleDetailType
  } from "@/api/article";
  import {
    getDetailform
  } from "@/api/login";
  export default {
    data() {
      return {
        res: "",
      };
    },
    mounted() {},
    onLoad(option) {
      if (option.type) {
        uni.setNavigationBarTitle({
          title: this.way[option.type].title,
        });
        this.init(option);
      }
      if (option.id) {
        this.initById(option.id)
      }
    },

    methods: {
      init(option) {
        getArticleDetailType(this.way[option.type].type).then((res) => {
          // console.log(res,"111111")
          if (res.data.success) {
            console.log(res.data.result)
            this.res = res.data.result;
          }
        });
      },
      initById(id) {
        getDetailform({
          id: id
        }).then(res => {
          if (res.data.success) {
             this.res = res.data.result;
          }
        })
      }
    },
  };
</script>
<style lang="scss" scoped>
  .wrapper {
    padding: 16rpx;
  }
</style>
